#!/bin/sh
# Stream video URL through youtube-dl reading stdin or shell arguments

if [ ${#} -gt 0 ]; then
	# Shell arguments
	youtube-dl ${@} -o - | mpv --no-resume-playback -
elif [ ! -t 0 ]; then
	# stdin
	youtube-dl -a - -o - | mpv --no-resume-playback -
fi

exit
